#include<vector>
#include<string>
using namespace std;
class Solution {
public:
    string reverseStr(string s, int k) {
        int len = s.size(), mod = 2 * k;
        printf("%d %d\n", len, mod);
        int cnt = len / mod;
        printf("%d\n", cnt);
        len = s.size();
        int remainer = len % mod;
        printf("%d\n", remainer);
        if (remainer >= k)cnt++;
        if (remainer < k)reverse(s.end() - remainer, s.end());
        for (int i = 0; i < cnt; i++) {
            auto pos = s.begin() + i * mod;
            reverse(pos, pos + k);
        }
        return s;
    }
};